﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<JumJob.Models.Category>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Categorias
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% foreach (var category in Model)
       {

           List<JumJob.Models.Job> jobs = category.getJobList(int.Parse(ViewData["jobs_per_category"].ToString()));
           int jobCount = category.getJobCount();   
    %>
            <%if (jobCount > 0)//Si la categoria no tiene trabajos no la imprimimos
              { %>
            <div>
                <h2 style="font-size: x-large">
                    <%:category.name%></h2>
            </div>
            <%Html.RenderPartial("~/Views/Job/Jobs.ascx", jobs); %>
            <%if (jobCount > (int.Parse(ViewData["jobs_per_category"].ToString())))
              {%>
            <div style="text-align: right">
                <a href="<%:Url.Action("ListJobs","Category")+"?id="+category.id%>" class="nav">Ver
                    mas...</a>
            </div>
            <%} %>
    <br />
    <br />
    <%} %>
    <% } %>
</asp:Content>
